#ifndef __INF_ES8311_H__
#define __INF_ES8311_H__

#include "Com_Debug.h"
#include "Com_Config.h"
#include "driver/gpio.h"

/**
 * @brief Codec configuration by ESP32S3_KORVO2_V3
 */
#define I2C_SDA_PIN GPIO_NUM_0
#define I2C_SCL_PIN GPIO_NUM_1

#define I2S_BCK_PIN GPIO_NUM_2
#define I2S_MCK_PIN GPIO_NUM_3
#define I2S_DATA_IN_PIN GPIO_NUM_4
#define I2S_DATA_OUT_PIN GPIO_NUM_6
#define I2S_DATA_WS_PIN GPIO_NUM_5

#define BOARD_PA_PIN GPIO_NUM_6

/**
 * @brief 初始化I2S
 *
 * @param port
 * @return int
 */
int Inf_ES8311_I2C_Init(void);

esp_err_t Inf_ES8311_I2S_Init(void);

// 初始化
void Inf_ES8311_Init(void);

/**
 * @description: 从麦克风读取数据
 * @return {*}
 */
void Inf_ES8311_ReceData(char *data, int len);

/**
 * @description: 发送数据到扬声器
 * @return {*}
 */
void Inf_ES8311_SendData(char *data, int len);

#endif /* __INF_ES8311_H__ */
